function css_browser_selector(u){var ua=u.toLowerCase(),is=function(t){return ua.indexOf(t)>-1},g='gecko',w='webkit',s='safari',o='opera',m='mobile',h=document.documentElement,b=[(!(/opera|webtv/i.test(ua))&&/msie\s(\d)/.test(ua))?('ie ie'+RegExp.$1):is('firefox/2')?g+' ff2':is('firefox/3.5')?g+' ff3 ff3_5':is('firefox/3.6')?g+' ff3 ff3_6':is('firefox/3')?g+' ff3':is('gecko/')?g:is('opera')?o+(/version\/(\d+)/.test(ua)?' '+o+RegExp.$1:(/opera(\s|\/)(\d+)/.test(ua)?' '+o+RegExp.$2:'')):is('konqueror')?'konqueror':is('blackberry')?m+' blackberry':is('android')?m+' android':is('chrome')?w+' chrome':is('iron')?w+' iron':is('applewebkit/')?w+' '+s+(/version\/(\d+)/.test(ua)?' '+s+RegExp.$1:''):is('mozilla/')?g:'',is('j2me')?m+' j2me':is('iphone')?m+' iphone':is('ipod')?m+' ipod':is('ipad')?m+' ipad':is('mac')?'mac':is('darwin')?'mac':is('webtv')?'webtv':is('win')?'win'+(is('windows nt 6.0')?' vista':''):is('freebsd')?'freebsd':(is('x11')||is('linux'))?'linux':'','js']; c = b.join(' '); h.className += ' '+c; return c;}; css_browser_selector(navigator.userAgent); Drupal.behaviors.iiitdSuperfish = function (context) { // Modify the menu before applying superfish on it // Entirely remove the third level of menu $("div#primary-menu ul.sf-navbar li.expanded ul.menu li ul").remove(); // Do not show the arrow in the second level $("div#primary-menu ul.sf-navbar li.expanded ul.menu li").removeClass("expanded").removeClass("collapsed").addClass("leaf"); $("div#primary-menu ul.sf-navbar").superfish({ hoverClass: 'sfHover', pathLevels: 2, pathClass: 'active-trail', delay: 800, animation: {opacity:'show'}, speed: 'normal',//200, autoArrows: true, dropShadows: false, disableHI: false }).supposition(); // Adjust width of primary menu second-level entries $("div#primary-menu ul.sf-navbar > li > ul").each(function(){ var li_list = $(this).children("li"); if (li_list.length > 4) { $(li_list).each(function(){ $(this).children().css({'paddingRight':'10px','paddingLeft':'10px'}); }); } }); }; // Change defaults too - otherwise, second level does not show the active-trail $.fn.superfish.defaults.pathClass = 'active-trail'; $.fn.superfish.defaults.pathLevels = 2; // Destroy default fusionSuperfish initialization. /* Explanation: default fusionSuperfish disables HI during its initialization - * which, attaches a jquery hover() handler. The jquery hover handler attaches * mouseenter and mouseleave events to the element. The mouseenter handler first * actually changes the eventype to 'mouseenter' and then calls the handler. * * Now, HI requires handlers for mouseover and mouseout. However, upon firing * those events, first the hover handler is called. So, by the time the HI * handler is called, the event type has already been changed to mouseenter/mouseleave! * And that is how the cookie crumbled everytime. */ Drupal.behaviors.fusionSuperfish = function (context) { }; Drupal.behaviors.fusionSuperfishBlocks = function (context) { }; // Add some shadows Drupal.behaviors.iiitdShadow = function (context) { if(! $.browser.msie || ! /^[6,7,8,9].*/.test($.browser.version)) { $("#main").css({'-moz-box-shadow':'0 0 0 grey','-webkit-box-shadow':'0 0 0 grey','box-shadow':'0 0 0 grey'}); } }; Drupal.behaviors.removeRecentNewsEmptyPhotoCell = function (context) { $('body#pid-home div.view-Recent-News table > tbody > tr').each(function() { var cells = $('td', this); if ($(cells[0]).hasClass('views-field-field-photo-imceimage-path')) { if ($(cells[0]).children().length == 0) { // For items with no photo, merge the photo cell and title cell $(cells[0]).remove(); $(cells[1]).attr('colspan', 2); // $(cells[1]).prepend('♦ '); } else { // Remove the height attr from the img tag $('> img', $(cells[0])).removeAttr('height'); } } }); }; Drupal.behaviors.eventEmptyBody = function (context) { $(".event-link").each(function(){ window.location.replace($(this).text()); }); };